# -*- coding: utf-8 -*-
from flask import Flask
from config import conf
from app.urls import indexBlueprint
from flask_migrate import MigrateCommand, Migrate
from app.models import User, db
from flask_script import Manager


setting = conf["Default"]
app = Flask(
    __name__,
    static_folder=setting.STATIC_FOLDER,
    template_folder=setting.TEMPLATE_FOLDER
)
app.config.from_object(setting)
app.register_blueprint(indexBlueprint)
db.init_app(app=app)
Migrate(db=db, app=app)
manager = Manager(app)
manager.add_command("db", MigrateCommand)


if __name__ =="__main__":
    manager.run()